<?php

class BC_Colorswatch_Helper_Data extends Mage_Core_Helper_Abstract
{
	public function bcCheckConfigurableProduct($product){
        return $product->isConfigurable();
    }
    public function bcgetProductAttributes($product){
        return $product->getTypeInstance()->getConfigurableAttributesAsArray();
    }
	public function bcCheckAttributeActive($attr_id){
		$activedAttributes = Mage::getStoreConfig('bccolorswatch/info/selected_attributes',Mage::app()->getStore());
		if(!$activedAttributes) return false;
		$activedAttributes = explode(",", $activedAttributes);
		if(in_array($attr_id, $activedAttributes))
			return true;
		else
			return false;
	}
}